package org.example;

import org.example.config.SpringConfig;
import org.example.dao.UserDao;
import org.example.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
        //创建IOC容器
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
//        UserDao userDao = ctx.getBean(UserDao.class);
//        userDao.getList();
        UserService userService = ctx.getBean(UserService.class);
        userService.getList();
    }
}
